package com.jml.impl;
//
//import com.codingapi.txlcn.tc.annotation.LcnTransaction;
//import com.codingapi.txlcn.tc.config.EnableDistributedTransaction;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.jml.impl.entity.DispatchEntity;
import com.jml.impl.mapper.DispatchMapper;
import feign.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class DistributeServiceImpl implements DistributeService {
    @Autowired
    private DispatchMapper dispatchMapper;

    @Override
    @LcnTransaction
    @Transactional
    @RequestMapping("/distributeOrder")
    public String distributeOrder(@Param("orderId") String orderId) {
        DispatchEntity dispatchEntity = new DispatchEntity(orderId, 123456L);
        dispatchMapper.insertDistribute(dispatchEntity);
        return "插入数据成功";
    }
}
